// test0.cpp file
//
// Created on: 2017/5/13
//     Author: Bochen Yan

#include "test0.h"

shape::shape(const string c) : color(c){}
string shape::getColor() const {
    return this->color;
}

rectangle::rectangle(const string c) : shape(c){}
rectangle::rectangle(const string c, int w, int h) : shape(c), width(w), height(h){}
int rectangle::getArea() const {
    return this->width * this->height;
}

square::square(const string c, int l) : rectangle(c), length(l){}
int square::getArea() const {
    return this->length * this->length;
}